class CreateUserTalk < ActiveRecord::Migration
  def self.up
    create_table :user_talks do |t|
      t.integer :user_id, :null => false, :options =>
"CONSTRAINT fk_user_talk_users foreign key (user_id) REFERENCES users(id)"
      t.integer :talk_id, :null => false, :options =>
"CONSTRAINT fk_user_talk_talks foreign key (talk_id) REFERENCES talks(id)"

      t.integer :status, :default => 0 # 0 :normal; 1 :quit
      
      t.integer :star, :default => 1
            
      t.timestamps
    end
  end
  
  def self.down
    drop_table :user_talks
  end
end

